package com.daocao.sysuser.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.daocao.common.domain.dto.UmsDetailResumeDto;
import com.daocao.common.domain.entity.UmsDetailResume;
import com.daocao.common.response.DaoCaoPageResult;
import com.daocao.common.response.DaoCaoResult;
import com.daocao.common.service.IUmsDetailResumeService;

@RestController
@RequestMapping("sys/detail")
public class DetailResumeController {

    @Autowired
    private IUmsDetailResumeService detailResumeService;

    @GetMapping("/info")
    public DaoCaoResult searchUserInfo(UmsDetailResumeDto detailResumeDto) {
        DaoCaoPageResult<UmsDetailResume> pageResult = detailResumeService.searchList(detailResumeDto);

        return DaoCaoResult.success(pageResult);
    }

     /**
      * 删除数据
      * @param insertTimes
      * @return
      */
     @DeleteMapping
     public DaoCaoResult removeResume(@RequestBody String[] insertTimes) {
         int row = detailResumeService.removeResume(insertTimes);
         if(row > 0) {
             return DaoCaoResult.success();
         }
         return DaoCaoResult.error();
     }
}
